package com.polylink.base;

import java.util.List;
import java.util.Map;

/**
 *@author xiliang.xiao
 *@date 2015年3月23日 上午9:36:42
 *
 **/
public class Page {

	private int page;
	private int pageSize;
	private int total;
	private List<?> rows;
	private int begin;
	private int end;
	/**
	 * 排序方式asc , desc
	 */
	private String sort;
	/**
	 * 排序字段
	 */
	private String order;
	
	/**
	 * 搜索条件
	 */
	private Map<String,Object> query;

	public int getPage() {
		return page;
	}

	public void setPage(int page) {
		this.page = page;
	}

	public int getPageSize() {
		return pageSize;
	}

	public void setPageSize(int pageSize) {
		this.pageSize = pageSize;
	}

	public String getSort() {
		return sort;
	}

	public void setSort(String sort) {
		this.sort = sort;
	}

	public String getOrder() {
		return order;
	}

	public void setOrder(String order) {
		this.order = order;
	}

	public Map<String, Object> getQuery() {
		return query;
	}

	public void setQuery(Map<String, Object> query) {
		this.query = query;
	}

	public int getTotal() {
		return total;
	}

	public void setTotal(int total) {
		this.total = total;
	}

	public List<?> getRows() {
		return rows;
	}

	public void setRows(List<?> rows) {
		this.rows = rows;
	}

	public int getBegin() {
		return begin==0?((page-1)*pageSize):begin;
	}

	public void setBegin(int begin) {
		this.begin=begin;
	}

	public int getEnd() {
		return end==0?(page*pageSize):begin;
	}

	public void setEnd(int end) {
		this.end = end;
	}
	
}
